<?php
$toolbar    =new ToolBarHelper($act);
$toolbar->setSubmitAjax(true);

if($act=="email")
{
    $toolbar->SetTitle('[Email manager]');
    $toolbar->Back(getUrlBack());
    $toolbar->Delete('delemail');
    $toolbar->Apply();
    $toolbar->Send('sendnewsletter','Send Newsletter',true);
    $toolbar->Export('export','Export email');
}
else if($act=='sendnewsletter')
{
    $toolbar->SetTitle('[Send newsletter]');
    $toolbar->Back('?module='.$module.'&opt=email&id='.$id);
    $toolbar->Send();    
}
else if($act=='add')
{
    $toolbar->SetTitle('[New]');
    $toolbar->Back(getUrlBack());
    $toolbar->Save('Save');    
}
else if($act=='edit')
{
    $toolbar->SetTitle('[Edit]');
    $toolbar->Back(getUrlBack());
    $toolbar->Apply();
    $toolbar->Save();
    $toolbar->background('content',"List Content",'id='.$id);
}
else if($act=='addcontent')
{
    $toolbar->SetTitle('[New Content]');
    $toolbar->Back('?module='.$module.'&opt=content&id='.$id);
    $toolbar->Save('Save',2);
    $toolbar->Save('Save & Exit');    
}
else if($act=='editcontent')
{
    $toolbar->SetTitle('[Edit Content]');
    $toolbar->Back('?module='.$module.'&opt=content&id='.$content['iParentId']);
    $toolbar->Apply();
    $toolbar->Save();
}
else if($act=='content')
{
    $toolbar->SetTitle('[List Content]');
    $toolbar->Back('?module='.$module.'&opt=edit&id='.$id);
    $toolbar->Delete('delcontent');
    $toolbar->Apply();
    $toolbar->addNew('addcontent','New Content','id='.$id);
}
else
{    
    $toolbar->setSubmitAjax(false);    
    $toolbar->Delete();
    $toolbar->Apply();
    $toolbar->addNew('add','New ','id='.$id);
    $toolbar->background("email","Emails");
}
?>